using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class PlayerInput : MonoBehaviour
{
    public PlayerInputAction InputAction { get; private set; }
    public PlayerInputAction.PlayerActions PlayerActions { get; private set; }

    private void Awake()
    {
        InputAction = new PlayerInputAction();
        PlayerActions = InputAction.Player;
    }

    private void OnEnable()
    {
       InputAction.Enable();
    }

    private void OnDisable()
    {
        InputAction.Disable();
    }

    public void SetActionDisableForSeconds(InputAction inputAction, float seconds)
    {
        StartCoroutine(IESetActionDisableForSeconds(inputAction, seconds));
    }

    private IEnumerator IESetActionDisableForSeconds(InputAction inputAction, float seconds)
    {
        inputAction.Disable();
        yield return new WaitForSeconds(seconds);
        inputAction.Enable();
    }
}
